package net;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
	private ObjectOutputStream out;
	private ObjectInputStream input;
	private Socket socket;
	private ServerSocket serverSocket;
	
//	public static void main(String[] args){
//		new Server();
//	}
	public Server(){
		try {
			serverSocket = new ServerSocket(8000);
			System.out.println("Server Start");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	
	go();
	}
	private void go(){
		try{
			while(true){
				socket = serverSocket.accept();
				CommandThread ot = new CommandThread(socket);
				ot.start();
			}
		}catch(IOException e){
			e.printStackTrace();
		}
		
	}

}
